// 引入二次封装axios
import request from '@/utils/request'
import type { trademarkResponseData ,trademark} from './model/tardemark'
// 枚举
enum API {
    TARDEMARKLIST = '/admin/product/baseTrademark/',
    ADDTRADEMARK = '/admin/product/baseTrademark/save',
    UPDATETRADEMARK = '/admin/product/baseTrademark/update',
    DELETE='/admin/product/baseTrademark/remove/'
}

// 商品数据
export const reqTardemarkList = (page: number, limit: number) => request.get<any, trademarkResponseData>(API.TARDEMARKLIST + `${page}/${limit}`)

// 添加或修改商品
export const reqAddOrUpdateTrademark = (data:trademark) => {
    if (data.id) {
        return request.put<any,any>(API.UPDATETRADEMARK,data)
    } else {
       return request.post<any,any>(API.ADDTRADEMARK,data)
    }
}
// 删除
export const reqDelTrademark=(id:number)=>request.delete(API.DELETE+`${id}`)